<?php
$arrMenu = $this->arrMenu;
$arrParam = Fpt_Global::getParentParams();
$cateCode = $arrParam['catename'];

$classActive = '';
if($arrParam['controller']=='index')
{
    $classActive = 'active';
}
if(!empty($arrMenu))
{
?>
<div class="menu_site">
    <ul class="main_menu">
        <li class="<?php echo $classActive;?>"><a href="<?php echo SITE_URL;?>" class="parent_menu">Trang chủ</a> </li>
        <?php
        $count = 1;
        $total = count($arrMenu);
        foreach($arrMenu as $dataMenu)
        {
            $classActive = '';
            $classEnd = '';
            if($count==$total)
            {
                $classEnd = 'end';
            }
            if($cateCode==$dataMenu['catecode'])
            {
                $classActive = 'active';
            }
        ?>
            <li class="<?php echo $classEnd;?> <?php echo $classActive;?>"><a href="<?php echo SITE_URL.'/'.$dataMenu['catecode'];?>" class="parent_menu"><?php echo $dataMenu['catename'];?> </a> </li>
        <?php
            $count++;
        }
        ?>
    </ul>
</div>
<?php
}
?>